﻿@inherits BaseComponent

@if (Model.HasItem)
{
    <div class="boot-toolbar btn-group" role="group">
        @foreach (var item in Model.Items)
        {
            var itemName = Language.GetString(item);
            var color = item.Style == "danger" ? Color.Danger : Color.Primary;
            <Button Color="color" Icon="@item.Icon" OnClick="e=>Model.OnItemClick?.Invoke(item)">@itemName</Button>
            @if (item.Children != null && item.Children.Count > 0)
            {
                @*<Dropdown TValue="ActionInfo" Items="item.Children" OnSelectedItemChanged="@(e=>Model.OnItemClick?.Invoke(e.Value))" Color="Color.Secondary" />*@
            }
        }
    </div>
}

@code {
    [Parameter] public ToolbarModel Model { get; set; }
}